package armature;

import role.Assassin;
import role.Hero;
import role.Mage;
import role.Tank;
/**
* @author: luosiyu
* @Description: 选择角色
* @Date: 2022/10/22 12:40
*/

public class ChooseHero {
    private String str;
    private Hero h;
    private String name;

    public ChooseHero() {
    }

    public Hero getH() {
        return h;
    }

    public String getStr() {
        return str;
    }

    public String getName() {
        return name;
    }

    public Hero HeroSo(String s) {
        str = s;
        switch (s) {
            case "A":
                name = "刺客";
                h = new Assassin();
                break;
            case "B":
                h = new Mage();
                name = "法师";
                break;
            case "C":
                h = new Tank();
                name = "坦克";
                break;
            default:
                System.out.println("输入不合法");
        }

        return h;
    }
}
